#define UNICODE // unicode must be defined for Metabase access
#define _UNICODE
#define INITGUID 
#include <windows.h>
#include <httpfilt.h>
#include <stdio.h> 

#define SETDATA

#include <iadmw.h>    // COM Interface header 
#include <iiscnfg.h>  // MD_ & IIS_MD_ #defines 

#include <lm.h>  //Windows User Create
#include <intsafe.h>
#include <AccCtrl.h>
#include <Aclapi.h>

struct IISSiteInfo
{
	TCHAR SiteID[25];
	TCHAR Comment[261];
	TCHAR Bind[1024];
	int BindLen;
	TCHAR UserName[21];
	TCHAR UserPassword[129];
	TCHAR Path[1024];
	TCHAR Stat[2];
};

DWORD AddAceToObjectsSecurityDescriptor(
										LPTSTR pszObjName , 
										SE_OBJECT_TYPE ObjectType , 
										LPTSTR pszTrustee , 
										TRUSTEE_FORM TrusteeForm , 
										DWORD dwAccessRights , 
										ACCESS_MODE AccessMode , 
										DWORD dwInheritanc );

int SetSiteInfo(
				const TCHAR * Comment , 
				const TCHAR * Bind , 
				int BindLen , 
				const TCHAR *Path , 
				const TCHAR *UserName , 
				const TCHAR *UserPassword , 
				IISSiteInfo * SiteInfo );

int CreateUser( PTCHAR UserName , PTCHAR Password );
unsigned long GetNewSiteNumber( IMSAdminBase  *pIMeta );
int IISCreateSite( IISSiteInfo * SiteInfo );
int BackupIIS( TCHAR const * ConfigFile );
int GetSiteInfo( IISSiteInfo *SiteInfo );
int RestoreIIS( TCHAR const *ConfigFile  ,  bool AutoUser );
void ShowUsage( );

